package org.jground.rx.ui.zk.login;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;
import org.jground.rx.RXAccess;

public class MemberInitServlet extends HttpServlet {

    //
    private static Log logger = LogFactory.getLog(MemberInitServlet.class);

    public MemberInitServlet() {

    }

    public void init(ServletConfig config) throws ServletException {
        synchronized (MemberInitServlet.class) {
            super.init(config);
            try {
                MemberService.initialize(RXAccess.INITIAL_SYSADMIN_USERNAME, RXAccess.INITIAL_SYSADMIN_ROLES,
                        RXAccess.INITIAL_SYSADMIN_PASSWORD);
            } catch (Exception e) {
                logger.error(e, e);
            }
            logger.info("MemberInitServlet init :: DONE");
        }
    }

    public void destroy() {

    }

}
